#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\MHT.h>

const char*MHTName = "MHT.dat";

static MHT_REC srMHTRec;

static int recordNum;
int	inLoadMHTRec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(MHT_FILENAME, SIZE_MHT_REC, inRecNumber, (char *) &srMHTRec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetMHTRec(void)
{
	return &srMHTRec;

}

int	inSaveMHTRec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(MHT_FILENAME, SIZE_MHT_REC, inRecNumber, (char *) &srMHTRec);

	return inRet;
}

int	inGetMHTRecNumber (void)
{
	return recordNum;
}

int	inUpdateMHTRec (void)
{
	int inRet;

	inRet = inSaveConfRec(MHT_FILENAME, SIZE_MHT_REC, recordNum, (char *) &srMHTRec);

	return inRet;
}

void	vdResetMHTRec (void)
{
	memset((void*)&srMHTRec, 0, REC_SIZEOF(srMHTRec));
}

long lnGetSTAN(void)
{
	return srMHTRec.lnSTAN;
}

void vdSetSTAN(long lnSTAN)
{
	srMHTRec.lnSTAN = lnSTAN;
}

short shGetHostInvNum(void)
{
	return srMHTRec.shHostInvNum;
}

void vdSetHostInvNum(short shHostInvNum)
{
	srMHTRec.shHostInvNum = shHostInvNum;
}

long lnGetBatchNum(void)
{
	return srMHTRec.lnBatchNum;
}

void vdSetBatchNum(long lnBatchNum)
{
	srMHTRec.lnBatchNum = lnBatchNum;
}

VS_BOOL fGetMustSettleFlag(void)
{
	return srMHTRec.fMustSettleFlag;
}

void vdSetMustSettleFlag(VS_BOOL fMustSettleFlag)
{
	srMHTRec.fMustSettleFlag = fMustSettleFlag;
}

VS_BOOL fGetMustClear(void)
{
	return srMHTRec.fMustClear;
}

void vdSetMustClear(VS_BOOL fMustClear)
{
	srMHTRec.fMustClear = fMustClear;
}

